<template>
    <div class="content">
        <!-- 一级路由挂载点 -->
        <router-view v-slot="{ Component, route }">
            <!-- 这里的组件是需要缓存的 -->
            <keep-alive>
                <component :is="Component" v-if="route.meta.keepAlive" :key="route.fullPath"></component>
            </keep-alive>
            <!-- 这里组件不需要缓存 -->
            <component :is="Component" v-if="!route.meta.keepAlive"></component>
        </router-view>
    </div>
</template>

<script setup lang='ts'>
import { useRoute } from 'vue-router';
const route = useRoute();

</script>

<style lang=''>

</style>